<template>
    <div>
        <h1>Map-扩展方法</h1>

        <!-- 转json对象字符串 -->
        <h3>toJson-将map内容转为json对象字符串</h3>
        <div class="code">
            const map1 = new Map()
            <br />
            map1.set('name', 1)
            <br />
            map1.set('age', 2)
            <br />
            map1.set('ok', true)
            <br />
            console.log(map1.toJson()) //{"name":1,"age":2,"ok":true}
            <br />
        </div>
    </div>
</template>
<script setup lang="ts">
</script>
<style lang="less" scoped></style>
